package com.cloudcc.boot.entity.mdm.wbs;

import com.cloudcc.boot.enums.WbsStatusEnum;
import com.cloudcc.boot.enums.YesOrNoEnum;

public class WbsConvert {

    public static CRM_WBS_DO convert(SecondaryMDM_WBS_Vo wbs) {
        CRM_WBS_DO wbsDO = new CRM_WBS_DO();
        wbsDO.setCode(wbs.getCODE());
        wbsDO.setName(wbs.getWBS_Name());
        wbsDO.setProjectNumber(wbs.getProject_Number());
        wbsDO.setParentWBSCode(wbs.getParent_WBS_Code());
        wbsDO.setResponsibleOrganization(wbs.getResponsible_Organization());
        wbsDO.setPlannedStartDate(wbs.getPlanned_Start_Date());
        wbsDO.setPlannedEndDate(wbs.getPlanned_End_Date());
        wbsDO.setStartDate(wbs.getStart_Date());
        wbsDO.setEndDate(wbs.getEnd_Date());
        wbsDO.setWorkloadUnitNumber(wbs.getWorkload_Unit_Number());
        wbsDO.setPlannedWorkload(wbs.getPlanned_Workload());
        wbsDO.setActualWorkload(wbs.getActual_workload());
        wbsDO.setPlannedDate(wbs.getPlanned_Date());
        wbsDO.setActualDate(wbs.getActual_Date());
        wbsDO.setResponsiblePerson(wbs.getResponsible_Person());
        wbsDO.setIsCompleted(YesOrNoEnum.fromString(wbs.getIs_Completed()));
        wbsDO.setRemark(wbs.getRemark());
        wbsDO.setClassification(wbs.getClassification());
        wbsDO.setWbsStatus(WbsStatusEnum.fromCode(wbs.getWBS_Status()));
        wbsDO.setProfitCenter(wbs.getProfit_Center());
        wbsDO.setScopeOfControl(wbs.getScope_of_Control());
        wbsDO.setIsStatisticalType(YesOrNoEnum.fromString(wbs.getIs_Statistical_Type()));
        wbsDO.setInvoiceElements(YesOrNoEnum.fromString(wbs.getInvoice_Elements()));
        return wbsDO;
    }

}
